#!/bin/bash

while true;
   do
        cat $1-queries.txt | while read query;
            do
                echo "-------------------------------------------------CALLING SERVICE--------------------------------------------------------------";
                echo http://localhost:$4/rizzo-analytics-services/v1/$1/${query};
                echo "----------------------------------------------------RESPONSE------------------------------------------------------------------";
                curl --digest -u $2:$3 -w '@curl-format.txt' -s "http://localhost:$4/rizzo-analytics-services/v1/$1/${query}";
        done;
done;